<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUcServiceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('uc_service', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_card_id')->default(0)->comment('用户会员卡ID');
            $table->integer('shop_id')->default(0)->comment('门店ID');
            $table->integer('user_id')->default(0)->comment('用户ID');
            $table->integer('car_id')->default(0)->comment('车辆ID');
            $table->string('car_num')->default("")->comment('车牌号');
            $table->integer('card_id')->default(0)->comment('会员卡ID');
            $table->integer('service_id')->default('0')->comment('服务ID');
            $table->string('service_name')->default('')->comment('服务名称');
            $table->integer('number')->default('0')->comment('洗车次数');
            $table->integer('old_number')->default('0')->comment('原洗车次数');
            $table->tinyInteger('range')->default('0')->comment('使用限制:0=全场通用,1=指定服务');
            $table->float('discount')->default(0.00)->comment('折扣');
            $table->date('start_time')->comment('开启日期');
            $table->date('end_time')->comment('结束日期');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('uc_service');
    }
}
